#!/bin/bash
#$Id: get-charsheet.sh 23 2010-09-19 09:40:22Z cdk@bitmech.com $
#
# download eve character sheet
# (c) 2010 bitmech.com; see LICENSE.
#
APIBASE=http://api.eve-online.com
METHOD=/char/CharacterSheet.xml.aspx
URL=${APIBASE}${METHOD}
OUTPUT=CharacterSheet.xml

#
# file containing api key data for the character you want
APIKEY=../auth/.apikey

wget --post-file ${APIKEY} -O ${OUTPUT} ${URL}>/dev/null 2>&1; rc=$? 
if [ ${rc} -ne 0 ]; then
    echo "There appears to have been a problem getting the charsheet."
else
    echo "Character sheet downloaded to file ${OUTPUT}."
fi
exit ${rc}
